# Maintainer: David Runge <dave@sleepmap.de>
pkgname=zita-mu1
pkgver=0.3.3
pkgrel=3
pkgdesc="A simple JACK app used to organise stereo monitoring"
arch=('loong64' 'x86_64')
url="https://kokkinizita.linuxaudio.org/linuxaudio/zita-mu1-doc/quickguide.html"
license=('GPL3')
groups=('pro-audio')
depends=('cairo' 'clxclient' 'clthreads' 'jack')
makedepends=('gendesk')
source=("https://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pkgname}-${pkgver}.tar.bz2")
sha512sums=('1e01a92840e12854ffeb33e713a6257bc60ce140f0e7786a06dee73bd2cd8ce7f4904327ea107456a4c64eb8bf636a863ff12d0505512d21471ff08eb9d3f12c')

prepare() {
  cd "${pkgname}-${pkgver}"
  # remove optimization
  # fix binary install
  sed -e '/native/d' \
      -i source/Makefile
  # XDG desktop file
  gendesk -n \
          --pkgname ${pkgname} \
          --pkgdesc "${pkgdesc}" \
          --name zita-mu1 \
          --categories "AudioVideo;Audio"
}

build() {
  cd "${pkgname}-${pkgver}/source"
  make PREFIX=/usr
}

package() {
  cd "${pkgname}-${pkgver}/source"
  make PREFIX=/usr DESTDIR="$pkgdir" install
  # docs
  install -t "${pkgdir}/usr/share/doc/${pkgname}" \
    -vDm644 ../{AUTHORS,README}
  # XDG desktop integration
  install -vDm 644 "../${pkgname}.desktop" \
    -t "${pkgdir}/usr/share/applications/"
  # html
  install -t "${pkgdir}/usr/share/doc/${pkgname}/html" \
    -vDm644 ../doc/html/*
}
# vim:set ts=2 sw=2 et:
